<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script charset="utf-8" type="text/javascript" src="../js/jquery-1.8.2.min.js"></script>
</head>
<body>
	<form action="">
		<input type="button" value="SDK数据采集" onclick="sdk()"/><br/>
		<input type="button" value="PC数据采集" onclick="pc()"/><br/>
		<input type="button" value="HTML数据采集" onclick="html()"/><br/>
		<input type="button" value="上传HDFS" onclick="upload()"/><br/>
		<input type="button" value="采集后清洗保存mongodb" onclick="cleared()"/>
		<a id="sdk"></a>
	</form>
</body>
<script type="text/javascript">
	function sdk(){
		var base = "[{'data_type':'SDK_CEPING_BASEDATA','user_toke':1,'longitude':'179.09','latitude':'298.02','ip':'127.0.0.1','net_type':1,'terminal_type':2},{'data_type':'SDK_CEPING_QUESTION','t_id':1000,'t_time':2000,'baby_id':1},{'data_type':'SDK_CEPING_SET','baby_id':1,'t_time':20000}]";
		$.ajax({
			url: 'http://localhost:8080/manager/getData',
			data: {'system_type':'SDK','commit_time':'2016-07-07 14:36:10','data_list':base},
			dataType: 'json',
			type: 'POST',
			success: function(res) {
				$("#sdk").html(res);
			}
		});
	}
	function pc(){
		var base = "[{'data_type':'PC_CEPING_QUESTION','t_id':1000,'t_title':'请选择下面三角形','t_time':3000,'baby_id':3,'baby_name':'liuliu1'},{'data_type':'PC_CEPING_SET','baby_id':3,'baby_name':'liuliu1','t_time':10000}]";
		$.ajax({
			url: 'http://localhost:8080/manager/getData',
			data: {'system_type':'PC','commit_time':'2016-07-07 14:36:10','data_list':base},
			dataType: 'json',
			type: 'POST',
			success: function(res) {
				$("#sdk").html(res);
			}
		});
	}
	function html(){
		var base = "[{'data_type':'HTML_PC_CEPING_LOGIN','kinder_id':5,'start_time':'2016-07-07 13:36:10','end_time':'2016-07-07 14:16:10'},{'data_type':'HTML_PC_CEPING_QUESTION','t_id':3,'t_title':'请现在多边形','t_time':2000,'baby_id':2,'baby_name':'liu5'},{'data_type':'HTML_PC_CEPING_SET','baby_id':2,'baby_name':'liu5','t_time':20000}]";
		$.ajax({
			url: 'http://localhost:8080/manager/getData',
			data: {'system_type':'HTML','commit_time':'2016-07-07 14:36:10','data_list':base},
			dataType: 'json',
			type: 'POST',
			success: function(res) {
				$("#sdk").html(res);
			}
		});
	}
	function upload(){
		$.ajax({
			url: 'http://localhost:8080/manager/uploadHdfs',
			type: 'POST',
			success: function(res) {
				$("#sdk").html(res);
			}
		});
	}
	function cleared(){
		$.ajax({
			url: 'http://localhost:8080/manager/dataClear',
			type: 'POST',
			success: function(res) {
				$("#sdk").html(res);
			}
		});
	}
</script>
</html>